package com.txh.blog.util;

import java.util.ResourceBundle;

public class ResourceBundleUtils {

    private ResourceBundleUtils(){
        throw new AssertionError("This obj is Not instance");
    }
    //防止重排序
    private static volatile ResourceBundle resourceBundle = null;

    public static ResourceBundle getResourceBundle(String fileName){
        if (resourceBundle == null){
            synchronized (ResourceBundleUtils.class){
                if (resourceBundle == null){
                     resourceBundle =ResourceBundle.getBundle(fileName);
                }
            }
        }

        return resourceBundle;
    }
}
